package com.face.server.entity;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 管理员
 */
@Document
@Data
public class Admin extends Entity {

    private Auth auth = new Auth();

    // 超级管理员
    private boolean isSuper;

    @DBRef
    private Role role;

    @NotNull
    private String name;


    private boolean sex;

    @NotNull
    private String identity;

    @NotNull
    private String phone;

    // 管理的楼庄列表
    @DBRef
    private List<DormitoryBuild> dormitoryBuilds = new ArrayList<>();

    // 楼幢号列表
    private List<Integer> dormitoryNumList = new ArrayList<>();

    // true 可用
    private boolean disable;

}
